import cx_Oracle
import sys
from db_ora.connection.conn import *
from bl.store.store_orm import *
from bl.store.store import *
import sqlite3 as db
from jfs_os.dir_utils import *

def main():
    connec = connect("ic_racs_work", "ic_racs_work", "dev10gse")
    cursor = connec.cursor() 
    cursor.execute(""" 
        select sysdate
         from dual""") 
    for actualValue in cursor: 
        print (actualValue)

    l_thing = thing()
    l_thing.id = 1
    l_thing.name = "Teeest"
    conn = db.connect('C:/work/install/jFS/sqlite3/test.db')
    insert(conn, l_thing)

def main2():
    flist = list_dir("c:\\work")
    l_thing = thing()
    l_thing.id = flist[0]
    l_thing.name = flist[1]
    conn = db.connect('C:/work/install/jFS/sqlite3/test1.db')
    load_files(conn, flist, "c:\\work")
    c = conn.cursor()
    c.execute('select * from dirs')
    for row in c:
        print(row)
    connect.close()

if __name__ == "__main__":
   main2()
   
